<%@page import="vo.Menu"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="vo.Person" %>
<!DOCTYPE html>
<html class="no-js" lang="zxx">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>商家修改菜品</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="manifest" href="site.webmanifest">
<link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico">
<!-- Place favicon.ico in the root directory -->

<!-- CSS here -->
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/owl.carousel.min.css">
<link rel="stylesheet" href="css/animate.min.css">
<link rel="stylesheet" href="css/nice-select.css">
<link rel="stylesheet" href="css/themify-icons.css">
<link rel="stylesheet" href="css/magnific-popup.css">
<link rel="stylesheet" href="css/meanmenu.css">
<link rel="stylesheet" href="css/fontawesome-all.min.css">
<link rel="stylesheet" href="css/slick.css">
<link rel="stylesheet" href="css/default.css">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/responsive.css">
</head>
<body>
	<script type="text/javascript">
		function verificationPicFile(file) {
			var fileTypes = [ ".jpg" ];//文件后缀只能是这五类
			var filePath = document.getElementById("image").value;//返回的是上传文件的路径名 例如：E:\xx\xxx.jpg
			//当括号里面的值为0、空字符、false 、null 、undefined的时候就相当于false
			if (filePath) {
				var isNext = false;
				var fileEnd = filePath.substring(filePath.indexOf("."));//截取文件名的后缀
				for (var i = 0; i < fileTypes.length; i++) {
					if (fileTypes[i] == fileEnd) {
						isNext = true;
						break;
					}
				}
				if (!isNext) {
					alert('不接受此文件类型');
					document.getElementById("image").value = "";//如果文件后缀名不符合，清空已选择文件
					return false;
				}
			} else {
				return false;
			}
		}
	</script>
	<!--[if lte IE 9]>
            <p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="https://browsehappy.com/">upgrade your browser</a> to improve your experience and security.</p>
        <![endif]-->

		<jsp:useBean id="user" class="vo.Person" scope="session"></jsp:useBean>
		<jsp:useBean id="menu" class="vo.Menu" scope="session"></jsp:useBean>
		<%
		if(user.getUser_name()==null){
			response.getWriter().println("<script LANGUAGE='javascript'> alert('请先登录！');</script>");
			response.sendRedirect("register.jsp");
		}
		%>
		<!-- header-start -->
		<header>
			<div id="sticky-header" class="header-top-area header-2 pr-60 pl-60">
				<div class="container-fluid">
					<div class="row">
						<div class="col-xl-3 col-lg-2">
							<!-- 此处添加用户名 -->
													<!-- menu profile quick info -->
				            <div class="profile clearfix">
				              <div class="profile_pic">
				                <img src="images/3.jpg" alt="..." class="img-circle profile_img" style="width:60px; height:60px; border-radius:100%; overflow:hidden;">
				              </div>
				              <div class="profile_info">
				                <a href="store_self_info.jsp"><h5><%=user.getUser_name() %></h5></a>
				              </div>
				            </div>
				           <!-- /menu profile quick info -->
						</div>
						<div class="col-xl-6 col-lg-8">
							<div class="main-menu text-center">
								<nav id="mobile-menu">
									<ul>
										<li class="active"><a href="store_index.jsp">主页 </a>

										</li>
										<li><a href="store_ad.jsp">广告</a></li>
										<li><a href="store_order.jsp">订单</a>

										</li>
										<li ><a href="store_dishes_upload.jsp">上传菜品</a>

										</li>
										<li><a href="store_ad_create.jsp">发布广告</a>

										</li>

									</ul>
								</nav>
							</div>
							<div class="mobile-menu"></div>
						</div>
					 <div class="col-xl-3 col-lg-2">
							<div class="header-right f-right d-none d-md-none d-lg-block">
                               <ul>
                                   <!-- 退出登录按钮 -->
                                   <li class="info-bar">
                                   	<a href="UserExitServlet">  
                                   		<img src="images/logout.png" width="40px"  higth="40px"/>                          

                            		</a>	
                          		  </li>
                               </ul>
                           </div>
						</div>

					</div>
				</div>
			</div>
		</header>
		<!-- header-end -->



	<div class="row">


		<div class="col-md-12 text-center">
			<!-- page content -->

			<div class="">
				<div class="page-title">
					<div class="title_left">
						<h3>修改菜品</h3>
					</div>
				</div>
				<div class="clearfix"></div>
				<div class="row">
					<div class="col-md-12 col-sm-12 ">
						<div class="x_panel">
							<div class="x_content">
								<br />
								<form id="demo-form2" data-parsley-validate
									class="form-horizontal form-label-left" method="post" action="UpdateMenuServlet?id=<%=menu.getMenu_id() %>" enctype="multipart/form-data">
									<div class="item form-group">
										<div class="col-md-6 col-sm-6 offset-md-3">
											<input type="text" id="first-name" required="required"
												class="form-control" name="menuName" placeholder="菜品名称" value=<%=menu.getMenu_name() %>>
										</div>
									</div>
									<div class="item form-group">
										<div class="col-md-6 col-sm-6 offset-md-3">
											<input type="text" id="last-name" name="menuPrice"
												required="required" class="form-control" placeholder="菜品价格" value=<%=menu.getMenu_price() %>>
										</div>
									</div>
									<div class="item form-group">
										<div class="col-md-6 col-sm-6 offset-md-3">
											<input id="middle-name" class="form-control" type="text"
												name="menuNotice" placeholder="菜品描述" value=<%=menu.getMenu_content() %>>
										</div>
									</div>
									<div class="item form-group">
										<div class="col-md-6 col-sm-6 offset-md-3">
											<label>菜品图片:</label><input type="file" name="filename" id="image"
												 onchange="verificationPicFile(this)"
												accept="image/*.jpg" />
										</div>
									</div>

									<div class="ln_solid"></div>
									<div class="item form-group">
										<div class="col-md-6 col-sm-6 offset-md-3">
											<button class="btn btn-primary" type="button">取消</button>
											<button type="reset" class="btn btn-danger">重置</button>
											<button type="submit" class="btn btn-success">提交</button>

										</div>
									</div>

								</form>
							</div>
						</div>
					</div>
				</div>
			</div>

			<!-- /page content -->
		</div>
	</div>


	<!-- brand-area-start -->
	<div class="brand-area yellow-bg pt-75 pb-75">
		<div class="container">
			<div class="row justify-content-between">
				<div class="brand-active owl-carousel">
					<div class="col-xl-12">
						<div class="brand-wrapper">
							<div class="brand-img">
								<img src="img/brand/1.png" alt="" />
							</div>
						</div>
					</div>
					<div class="col-xl-12">
						<div class="brand-wrapper">
							<div class="brand-img">
								<img src="img/brand/2.png" alt="" />
							</div>
						</div>
					</div>
					<div class="col-xl-12">
						<div class="brand-wrapper">
							<div class="brand-img">
								<img src="img/brand/3.png" alt="" />
							</div>
						</div>
					</div>
					<div class="col-xl-12">
						<div class="brand-wrapper">
							<div class="brand-img">
								<img src="img/brand/4.png" alt="" />
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<!-- brand-area-end -->

	<!-- Modal Search -->
	<div class="modal fade" id="search-modal" tabindex="-1" role="dialog"
		aria-hidden="true">
		<div class="modal-dialog" role="document">
			<div class="modal-content">
				<form>
					<input type="text" placeholder="Search here...">
					<button>
						<i class="fa fa-search"></i>
					</button>
				</form>
			</div>
		</div>
	</div>




	<!-- JS here -->

	<script src="js/vendor/modernizr-3.5.0.min.js"></script>
	<script src="js/vendor/jquery-1.12.4.min.js"></script>
	<script src="js/waypoints.min.js"></script>
	<script src="js/jquery.counterup.min.js"></script>
	<script src="js/bootstrap.min.js"></script>
	<script src="js/owl.carousel.min.js"></script>
	<script src="js/isotope.pkgd.min.js"></script>
	<script src="js/jquery.nice-select.min.js"></script>
	<script src="js/jquery.meanmenu.min.js"></script>
	<script src="js/slick.min.js"></script>
	<script src="js/ajax-form.js"></script>
	<script src="js/wow.min.js"></script>
	<script
		src="http://ditu.google.cn/maps/api/js?key=AIzaSyBceNl50o3BU6LrsIGJxSL9tKKvqBKIeVs"></script>
	<script src="js/jquery.scrollUp.min.js"></script>
	<script src="js/imagesloaded.pkgd.min.js"></script>
	<script src="js/jquery.magnific-popup.min.js"></script>
	<script src="js/plugins.js"></script>
	<script src="js/main.js"></script>
</body>
</html>
